Skip to content

[FEAT] 장소 리뷰 리스트 GET api 구현#357

Merged
88guri merged 3 commits intodevelopfrom
#333-feat-place-review
Apr 10, 2026
Merged

[FEAT] 장소 리뷰 리스트 GET api 구현#357
88guri merged 3 commits intodevelopfrom
#333-feat-place-review

Conversation

@88guri
Copy link
Copy Markdown
Contributor

@88guri 88guri commented Apr 9, 2026

🌳이슈 번호


resolves #356


☀️어떻게 이슈를 해결했나요?


  • 장소 상세에서 리뷰 목록을 조회하기 위한 API를 구현

  • PlaceReview 엔티티를 기반으로 placeId에 해당하는 리뷰를 최신순(createdAt DESC)으로 조회하도록 Repository 메서드를 작성

  • 조회된 리뷰 데이터는 PlaceReviewListItem DTO로 변환하여 응답하도록 구성
    이때,
    작성자 정보(userId, nickname, profileImageUrl)
    방문 날짜(visitedAt) 및 시간대(visitTimeSlot)
    리뷰 내용(content)
    리뷰 이미지 리스트(imageUrls)
    를 포함하도록 설계했습니다.

  • 이미지의 경우, S3에 저장된 file key를 클라이언트에서 사용할 수 있는 URL로 변환하기 위해 ImageUrlProvider를 활용하도록 수정

  • 서비스 레이어에서는 placeRepository.findActiveById()를 통해 존재하지 않는 장소에 대한 예외 처리를 추가하여 안정성을 확보

  • 최종적으로 리뷰 리스트를 GetPlaceReviewListResponse로 감싸 반환하도록 구현하여, API 응답 구조를 일관되게 유지


🗯️ PR 포인트

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요


  • 그 사용자 프로필 사진 받아오는 부분을 마이페이지쪽 코드 보고 비슷하게 구현했는데 이게 맞는지 궁금합니다.
    (테스트 유저에는 프로필 사진을 넣지 않아 null이 나옵니다)
  • 무한 스크롤 처리 같은걸 해줘야하는건지 궁금합니다.

테스팅 화면

스크린샷 2026-04-10 014030 스크린샷 2026-04-10 014038 스크린샷 2026-04-10 014050

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 장소별 리뷰 목록을 조회할 수 있는 기능이 추가되었습니다.
    • 조회되는 리뷰는 최신순으로 정렬되며, 각 리뷰의 작성자 정보(닉네임·프로필 이미지), 방문 날짜, 방문 시간대, 리뷰 이미지들을 함께 확인할 수 있습니다.

@88guri 88guri requested a review from uykm April 9, 2026 16:48
@88guri 88guri self-assigned this Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: de923673-2582-46a0-9a7a-2bfc6ed1ce6a

📥 Commits

Reviewing files that changed from the base of the PR and between e0126f9 and 835014f.

📒 Files selected for processing (1)
  • src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java

Walkthrough

특정 장소의 리뷰 목록을 조회하는 GET 엔드포인트를 추가했습니다. 컨트롤러, 서비스(구현체 포함), 리포지토리 쿼리, 그리고 응답 DTO 레코드들(리뷰 항목 및 목록 응답)이 도입되어 지정된 장소의 리뷰들을 생성일 역순으로 반환합니다.

Changes

Cohort / File(s) Summary
컨트롤러
src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java
GET /{placeId}/reviews 엔드포인트 추가: getPlaceReviews(...) 메서드 추가하여 서비스 결과를 CustomApiResponse<GetPlaceReviewListResponse>로 반환.
응답 DTO
src/main/java/org/sopt/solply_server/domain/review/dto/response/GetPlaceReviewListResponse.java, src/main/java/org/sopt/solply_server/domain/review/dto/response/PlaceReviewListItem.java
리뷰 목록 응답 레코드(GetPlaceReviewListResponse)와 리뷰 항목 레코드(PlaceReviewListItem) 추가. 항목은 리뷰·유저 식별자, 닉네임·프로필 이미지 URL, 내용, 방문일·시간대, 이미지 URL 리스트를 포함.
리포지토리
src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java
findAllByPlaceIdOrderByCreatedAtDesc(Long placeId) 쿼리 메서드 추가: user와 placeReviewImages를 fetch 조인하여 장소별 리뷰를 생성일 내림차순으로 조회.
서비스
src/main/java/org/sopt/solply_server/domain/review/service/PlaceReviewService.java, src/main/java/org/sopt/solply_server/domain/review/service/PlaceReviewServiceImpl.java
인터페이스에 getPlaceReviews(Long) 선언 추가 및 구현체에서 ImageUrlProvider 주입, 장소 검증, 리포지토리 호출, PlaceReviewListItem 매핑 후 GetPlaceReviewListResponse 반환 로직 구현.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Controller as PlaceReviewController
    participant Service as PlaceReviewService
    participant Repo as PlaceReviewRepository
    participant DB as Database
    participant ImgProv as ImageUrlProvider

    Client->>Controller: GET /api/places/reviews/{placeId}/reviews
    Controller->>Service: getPlaceReviews(placeId)
    Service->>Service: validate place exists & active
    Service->>Repo: findAllByPlaceIdOrderByCreatedAtDesc(placeId)
    Repo->>DB: Query with join fetch user & images
    DB-->>Repo: List<PlaceReview>
    Repo-->>Service: List<PlaceReview>

    loop for each review
        Service->>ImgProv: resolve profile image URL
        ImgProv-->>Service: profile image URL
        Service->>Service: map to PlaceReviewListItem
    end

    Service-->>Controller: GetPlaceReviewListResponse
    Controller-->>Client: CustomApiResponse<GetPlaceReviewListResponse>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • [Feat] 장소 리뷰 GET api #356 - 장소 리뷰 조회 API 구현: 이 PR은 GET 장소 리뷰 API(컨트롤러·서비스·리포지토리·DTO)를 구현하여 해당 이슈 목적과 일치합니다.

Suggested reviewers

  • leejisoo0617
  • bykbyk0401

Poem

🐰 리뷰 모아 한 바구니에 담아
GET 한 번에 쏙, 기록들 반짝반짝
프로필 빛나고 사진도 줄지어
장소의 이야기가 한눈에 펼쳐지네
토끼가 축하 춤을 추며 껑충! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR은 #333 이슈를 참조하지만, 해당 이슈는 [POST] 장소 리뷰 API 구현을 요구합니다. 현재 PR은 [GET] 리뷰 목록 조회 API를 구현하고 있어 이슈의 요구사항과 불일치합니다. PR 설명에 별도의 [GET] 리뷰 목록 조회 이슈 참조를 추가하거나, #333 이슈와의 관계를 명확히 설명하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 '[FEAT] 장소 리뷰 리스트 GET api 구현'으로, 변경사항의 주요 내용인 장소 리뷰 목록을 조회하는 GET API 구현을 명확하게 반영합니다.
Out of Scope Changes check ✅ Passed PR의 모든 변경사항은 장소 리뷰 목록 조회 기능 구현에 명확하게 범위 내에 있으며, 무관한 변경사항이 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #333-feat-place-review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java (1)

11-19: 리뷰/이미지 전체 적재는 데이터 증가 시 병목이 될 수 있습니다.

Line 11~19는 한 번에 전체 리뷰와 이미지를 모두 로딩합니다. 장소별 리뷰가 많아지면 결과 row가 크게 불어나 응답 지연/메모리 사용량이 커질 수 있으니, 페이지네이션(또는 최신 N개 제한 + 추가 조회) 구조를 고려해 주세요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java`
around lines 11 - 19, The current repository method
findAllByPlaceIdOrderByCreatedAtDesc in PlaceReviewRepository loads all reviews
and their images at once, which will scale poorly; change it to a paginated
two-step fetch: 1) add a pageable query that selects only review ids (e.g., a
new method like findReviewIdsByPlaceIdOrderByCreatedAtDesc(Long placeId,
Pageable pageable) or use existing signature but accept Pageable) to retrieve
paged review ids, and 2) add a second query to load reviews with images for
those ids (e.g., findAllByIdInFetchImages(List<Long> ids) that uses join fetch
pr.placeReviewImages) so you avoid join-fetch + Pageable limitations and large
result sets; update service logic to call the id-page query then the
fetch-by-ids query to return the paged reviews.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java`:
- Around line 31-33: The GET handler getPlaceReviews in PlaceReviewController
lacks authenticated user injection; add a method parameter annotated with
`@CurrentUserId` (e.g., `@CurrentUserId` Long userId) to enforce JWT-based
authentication, update the method signature in
PlaceReviewController.getPlaceReviews, pass the userId into any downstream call
(for example to placeReviewService.getPlaceReviews(placeId, userId) or adjust
service signature accordingly), and add the necessary import for the
`@CurrentUserId` annotation.

---

Nitpick comments:
In
`@src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java`:
- Around line 11-19: The current repository method
findAllByPlaceIdOrderByCreatedAtDesc in PlaceReviewRepository loads all reviews
and their images at once, which will scale poorly; change it to a paginated
two-step fetch: 1) add a pageable query that selects only review ids (e.g., a
new method like findReviewIdsByPlaceIdOrderByCreatedAtDesc(Long placeId,
Pageable pageable) or use existing signature but accept Pageable) to retrieve
paged review ids, and 2) add a second query to load reviews with images for
those ids (e.g., findAllByIdInFetchImages(List<Long> ids) that uses join fetch
pr.placeReviewImages) so you avoid join-fetch + Pageable limitations and large
result sets; update service logic to call the id-page query then the
fetch-by-ids query to return the paged reviews.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 5b9202bb-9b4d-4c44-bb61-52f88534cfe9

📥 Commits

Reviewing files that changed from the base of the PR and between a3736a2 and e0126f9.

📒 Files selected for processing (6)
  • src/main/java/org/sopt/solply_server/domain/review/controller/PlaceReviewController.java
  • src/main/java/org/sopt/solply_server/domain/review/dto/response/GetPlaceReviewListResponse.java
  • src/main/java/org/sopt/solply_server/domain/review/dto/response/PlaceReviewListItem.java
  • src/main/java/org/sopt/solply_server/domain/review/repository/PlaceReviewRepository.java
  • src/main/java/org/sopt/solply_server/domain/review/service/PlaceReviewService.java
  • src/main/java/org/sopt/solply_server/domain/review/service/PlaceReviewServiceImpl.java

@88guri 88guri merged commit 42b87c9 into develop Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 장소 리뷰 GET api

1 participant